home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / 80x0393.zip / SCROLL.ASM < prev    next >
Assembly Source File  |  1993-03-30  |  1KB  |  45 lines

  1. ;
  2. ; scroll.asm by Rich Paul
  3. ; This is a scroll routine, required by the color printing routine 
  4. ; cprint.asm. It takes 1/3 time of the bios routine.
  5. ;
  6.  
  7. .model small
  8. .286
  9. public scroll
  10. .code
  11.  
  12. ;-------------------------------------------------------------------------
  13. ;  Scroll the screen one line.
  14. ;  Calling conventions:  Don't worry 'bout it
  15. ;  All Registers Saved
  16.  
  17. scroll proc far
  18.         pusha                   ; Save std regs
  19.         push    ds              ; Save seg regs
  20.         push    es
  21.  
  22.         mov     ax,0b800h       ; Set seg regs --
  23.         mov     ds,ax           ; They're the same, but both for string
  24.         mov     es,ax           ; Commands
  25.  
  26.         mov     si,160          ; Set si to 160
  27.         xor     di,di           ; And di to 0
  28.  
  29.         mov     cx,(80*24)      ; cx is number to words on screen
  30.                                 ; - one row
  31.  
  32.         rep     movsw           ; move everything
  33.  
  34.         mov     ax,0720h        ; set up for spaces in white on black
  35.         mov     cx,80           ; and one line (of words)
  36.  
  37.         rep     stosw           ; store the words
  38.         pop     es
  39.         pop     ds
  40.         popa
  41.         ret
  42.  
  43. scroll endp
  44. end
  45.